# script1704 - Open a File
# Written by 
#
#####################################################
#
################## Functions ########################
#
def get_file_name():    #Get file name
	print()
#
	try:
		file_name=input("Please enter file to open: ")
		print()
		return file_name
		#
	except KeyboardInterrupt:
		print()
		print("Script terminating....")
		print()
		exit()
		#
	except:
		print()
		print("An error has occurred.")
		print("Script terminating...")
		print()
		exit()
		#
#
def open_it(file_name):       #Open file name
#
	try:
		my_file=open(file_name,'r')
		print("File", file_name, "opened successfully!")
		my_file.close()
		#
	except Exception as open_error:
		print("An error exception has been raised.")
		print("The error message is:")
		print(open_error)
		print()
		return()
		#
#
############## Mainline #############################
#
def main():
	file_name=get_file_name ()
	open_it(file_name)
#
############ Call the Main Function ###################
#
main()
